
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.AffineTransform;
import java.util.Arrays;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.Timer;


public class ExamplePanel extends JPanel implements  ActionListener{

	private Timer t;
	private Fractal f;
	
	public ExamplePanel(){
		super();
		
		t = new Timer(6, this);
		f = new Fractal();
		t.addActionListener(f);
		this.setBackground(Color.BLACK);
		System.out.println(Arrays.toString(t.getActionListeners()));
		t.start();
	
	}

	
	
	
	
	@Override
	public void paint(Graphics g){
		Graphics2D g2d = (Graphics2D)g;
		super.paint(g2d);
		g2d.setColor(Color.CYAN);
		f.paint(g2d);
	}

	public static void main(String[] args){
		ExamplePanel ex = new ExamplePanel();
		JFrame frame = new JFrame();
		
		frame.setSize(1024, 720);
		frame.getContentPane().setBackground(Color.BLACK);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.add(ex);
		frame.setVisible(true);
	}





	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		this.repaint();
	}

	
	


}
